
/***************************************************************************
 *   jell - library                                                        *
 *                                                                         *
 *   Copyright (C) 2008 by kuerant                                         *
 *                         <kuerant@gmail.com>                             *
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 *   This library is distributed in the hope that it will be usefull, but  *
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      *
 *   Library General Public License for more details.                      *
 *                                                                         *
 *   You should have received a copy of the GNU Library General Public     *
 *   License along with this library; if not, write to the Free Software   *
 *   Foundation, Inc., 59 Temple Place - Suite 330, Boston,                *
 *   MA 02111-1307, USA                                                    *
 ***************************************************************************/

#ifndef	JEFI_JELL_ADDRESS_HPP
#define	JEFI_JELL_ADDRESS_HPP

#include "jell/address.hpp"

namespace   jell
{

    class   JellAddress :   public  Address
    {

    public  :
        JellAddress();
        JellAddress( const std::string& uri );
        JellAddress( JellAddress& rhs );
        JellAddress( const JellAddress& rhs );

    public  :
        JellAddress& operator=(const JellAddress& rhs);
        JellAddress& operator=(JellAddress& rhs);
        JellAddress& operator=(const std::string uri);

    public  :
        std::string uri(void)      const { return m_uri; }

        const char* protocol(void) const { return m_protocol.c_str(); }
        const char* hostname(void) const { return m_hostname.c_str(); }
        int         port(void)     const { return m_port; }
        const char* path(void)     const { return m_path.c_str(); }
        const char* query(void)    const { return m_query.c_str(); }
        const char* anchor(void)   const { return m_anchor.c_str(); }

    private :
        void    parse( const std::string& uri );

    private :
        std::string m_uri;

        std::string m_protocol;
        std::string m_hostname;
        int         m_port;
        std::string m_path;
        std::string m_query;
        std::string m_anchor;
    };  // class URL

}   // namespace jell

#endif  // JEFI_JELL_ADDRESS_HPP

